var isWx=false;
wx.miniProgram.getEnv(function(res) {
    if(res.miniprogram){
        //小程序
        isWx=true;
    }else{
        isWx=false;
    }
});
//佣金明细
function goDetailPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/detail'});
    }else{
        window.location.href="/weChat/detail?memberId="+memberId;
    }

}

//客户
function goKhPage(memberId,reportState){
    if(reportState==null||reportState==""){
        reportState='1';
    }
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/kh&urlParam=reportState*'+reportState});
    }else{
        window.location.href="/weChat/kh?memberId="+memberId+"&reportState="+reportState;
    }
}
//积分兑换
function goJFDHPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/jfsc'});
    }else{
        window.location.href="/weChat/jfsc?memberId="+memberId;
    }
}
//我的订单
function goMyDetailPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/myDetail'});
    }else{
        window.location.href="/weChat/myDetail?memberId="+memberId;
    }
}
//我的积分
function goMyScorePage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/myScore'});
    }else{
        window.location.href="/weChat/myScore?memberId="+memberId;
    }
}
//我的搜索
function goSearchPage(memberId,cityId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/search&urlParam=cityId*'+cityId});
    }else{
        window.location.href="/weChat/search?memberId="+memberId+"&cityId="+cityId;
    }
}
//入驻申请
function goSettledPage(memberId,itemId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/settled&urlParam=itemId*'+itemId});
    }else{
        window.location.href="/weChat/settled?memberId="+memberId+"&itemId="+itemId;
    }
}
//积分兑换
function goAdvisePage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/advise'});
    }else{
        window.location.href="/weChat/advise?memberId="+memberId;
    }
}
//申请经纪人
function goSQJJRPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/sqjjr'});
    }else{
        window.location.href="/weChat/sqjjr?memberId="+memberId;
    }
}
//个人中心
function goMyPage(memberId){
    window.location.href="/weChat/my?memberId="+memberId;
    /*if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/my'});
    }else{
        window.location.href="/weChat/my?memberId="+memberId;
    }*/
}


//我要报备
function goWybbPage(memberId,cityId,itemId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/bbkh&urlParam=cityId*'+cityId+'#itemId*'+itemId});
    }else{
        window.location.href="/weChat/bbkh?memberId="+memberId+"&cityId="+cityId+"&itemId="+itemId;
    }
}
//房屋详情
function goFwPage(memberId,cityId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/fwxx&urlParam=cityId*'+cityId});
    }else{
        window.location.href="/weChat/fwxx?memberId="+memberId+"&cityId="+cityId;
    }
}
//小区详情
function goXqPage(memberId,id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/xq&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/xq?memberId="+memberId+"&id="+id;
    }
}
//分享详情
function goSharePage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/share'});
    }else{
        window.location.href="/weChat/share?memberId="+memberId;
    }
}
//客服
function goKeFu(memberId,imgUrl){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/coustom/coustom?imgUrl='+imgUrl})
    }else{

    }
}

//文章详情
function goArticlePage(memberId,id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/article&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/article?memberId="+memberId+"&id="+id;
    }
}

//文章详情
function goarticleUrlPage(memberId,id,url){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/articleUrl&urlParam=id*'+id+'#url*'+url});
    }else{
        window.location.href="/weChat/articleUrl?memberId="+memberId+"&id="+id+"&url="+url;
    }
}
//商品详情
function goProductDescPage(memberId,id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/productDesc&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/productDesc?memberId="+memberId+"&id="+id;
    }
}
//我的推广人员
function goMyMemberPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/myMember'});
    }else{
        window.location.href="/weChat/myMember?memberId="+memberId;
    }
}
//我的信息
function goWdmpPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/wdmp'});
    }else{
        window.location.href="/weChat/wdmp?memberId="+memberId;
    }
}
//提现
function goTixianPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/tixian'});
    }else{
        window.location.href="/weChat/tixian?memberId="+memberId;
    }
}
//提现明细
function goTixianListPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/tixianList'});
    }else{
        window.location.href="/weChat/tixianList?memberId="+memberId;
    }
}


// 登录
function goLoginPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/loginPage'});
    }else{
        window.location.href="/weChat/loginPage?memberId="+memberId;
    }
}
// 注册
function goRegisterPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/registerPage'});
    }else{
        window.location.href="/weChat/registerPage?memberId="+memberId;
    }
}
// 忘记密码
function goRepPasswordPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/repPasswordPage'});
    }else{
        window.location.href="/weChat/repPasswordPage?memberId="+memberId;
    }
}

// 首页
function goFistPage(memberId,cityId){
    if (cityId == null || cityId == "" || cityId == undefined || cityId == "") {
        cityId = "";
    }
    window.location.href="/weChat/index?memberId="+memberId+"&cityId="+cityId;
    /*if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/index&urlParam=cityId*'+cityId});
    }else{
        window.location.href="/weChat/index?memberId="+memberId+"&cityId="+cityId;
    }*/
}
// 楼盘信息
function goItemPage(memberId, id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/item&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/item?memberId="+memberId+"&id="+id;
    }
}
// 楼盘详情
function goItemDescPage(memberId, id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/itemDesc&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/itemDesc?memberId="+memberId+"&id="+id;
    }
}

// 推荐客户
function goCustomerEditPage(memberId, itemId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/customerEdit&urlParam=itemId*'+itemId});
    }else{
        window.location.href="/weChat/customerEdit?memberId="+memberId+"&itemId="+itemId;
    }
}
// 推荐客户-楼盘选择
function goAllCustomerEditPage(memberId){
    window.location.href="/weChat/allCustomerEdit?memberId="+memberId;
    /*if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/allCustomerEdit'});
    }else{
        window.location.href="/weChat/allCustomerEdit?memberId="+memberId;
    }*/
}
// 我推荐的客户
function goMyCustomerListPage(memberId, status){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/myCustomerList&urlParam=status*'+status});
    }else{
        window.location.href="/weChat/myCustomerList?memberId="+memberId+"&status="+status;
    }

}
// 我的收藏
function goMyCollectPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/myCollect'});
    }else{
        window.location.href="/weChat/myCollect?memberId="+memberId;
    }
}
// 我的信息
function goMyEditPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/myEdit'});
    }else{
        window.location.href="/weChat/myEdit?memberId="+memberId;
    }
}
// 跳转
function goJump(url,memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url='+url});
    }else{
        window.location.href = url+"&memberId="+memberId;
    }
}
//提现
function goTixianPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/tixian'});
    }else{
        window.location.href="/weChat/tixian?memberId="+memberId;
    }
}
//提现明细
function goTixianListPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/tixianList'});
    }else{
        window.location.href="/weChat/tixianList?memberId="+memberId;
    }
}
//佣金明细
function goDetailPage(memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/detail'});
    }else{
        window.location.href="/weChat/detail?memberId="+memberId;
    }
}
//登录授权
function goCheckPage(logo,url,urlParam,memberId){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/login/login?logo='+logo+'&url='+url+'&urlParam='+urlParam})
    }else{

    }
}